module.exports = `

  input AnswerCommentPayload {
    # TargetID of the comment, can be task/progress/document/answer/comment
    answerId: ID!

    # 是否需要重做
    isNeedRedo: Boolean!

    # The data {content, audios, images} of the comment

    # data: CommentInput
    data: JSON!
  }

  input ProgressRatingPayload {
    # TargetID of the comment, can be task/progress/document/answer/comment
    progressId: ID!
    # A rating number between 0-100
    rating: Int
    # like +1 cancel -1 default 0
    liked: Int
  }

  type Comment {
    id: ID!
    data: JSON
    userInfo: User
    createdAt: String
    updatedAt: String
    comments: [Comment]
    likeCount: Int
    liked: Boolean
  }

  extend type Mutation {
    # 为答案创建或更新评论
    createCommentForAnswer(input: AnswerCommentPayload!): Comment
    # 批量回复
    createBulkCommentsForTask(taskId: Int!, userIds: [Int!]!, data: JSON!, isNeedRedo: Boolean): Task
    # 创建或更新赞(评分)，如果是任务所有人，则可以修改相应作业的评分
    createRatingForProgress(input: ProgressRatingPayload!): Comment
    # 删除赞(评分)
    removeRatingForProgress(input: ProgressRatingPayload!): Comment
    # 删除评论
    # removeComment(id: ID!): Comment
  }

`
